// 开发的时候使用的路由
export const permissionRoutes = [
  {
    path: "/home",
    component: () => import("@/views/home/index.vue"),
    meta: {
      title: "首页",
      hidden: false,
      icon: "HomeFilled",
    },
  },
  {
    path: "/customComponents",
    name: "customComponents",
    meta: {
      title: "自定义组件",
      icon: "Link",
    },
    redirect: "/customComponents/customTable",
    children: [
      {
        path: "/customComponents/customTable",
        component: () =>
          import("@/views/customComponents/customTable/index.vue"),
        name: "customTable",
        meta: {
          title: "自定义表格",
          icon: "Grid",
          hidden: false,
        },
      },
      {
        path: "/customComponents/customChartView",
        component: () =>
          import("@/views/customComponents/customChartView/index.vue"),
        name: "customChartView",
        meta: {
          title: "自定义数据视图",
          icon: "DocumentRemove",
          hidden: false,
        },
      },
      {
        path: "/customComponents/customCollapse",
        component: () =>
          import("@/views/customComponents/customCollapse/index.vue"),
        name: "customCollapse",
        meta: {
          title: "自定义折叠面板",
          icon: "Operation",
          hidden: false,
        },
      },
      {
        path: "/customComponents/customTree",
        component: () =>
          import("@/views/customComponents/customTree/index.vue"),
        name: "customTree",
        meta: {
          title: "自定义tree",
          icon: "OfficeBuilding",
          hidden: false,
        },
      },
      {
        path: "/customComponents/customMenu",
        component: () =>
          import("@/views/customComponents/customMenu/index.vue"),
        name: "customMenu",
        meta: {
          title: "手撸菜单",
          icon: "Menu",
          hidden: false,
        },
      },
    ],
  },
  {
    path: "/indexeddbView",
    component: () => import("@/views/indexeddbView/index.vue"),
    name: "indexeddbView",
    meta: {
      title: "indexeddb数据库操作",
      icon: "FolderAdd",
      hidden: false,
    },
  },
];

//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
  {
    path: "/login",
    component: () => import("@/views/login/index.vue"),
    name: "login",
    meta: {
      title: "登录", //菜单标题
      hidden: true, //代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
      icon: "Promotion", //菜单文字左侧的图标,支持element-plus全部图标
    },
  },
  {
    path: "/",
    component: () => import("@/layout/index.vue"),
    name: "layout",
    meta: {
      title: "",
      hidden: false,
      icon: "MoreFilled",
    },
    redirect: "/home",
    children: [...permissionRoutes],
  },
  {
    path: "/404",
    component: () => import("@/views/404/index.vue"),
    name: "404",
    meta: {
      title: "404",
      hidden: true,
      icon: "DocumentDelete",
    },
  },
];

//任意路由
export const anyRoute = {
  path: "/:pathMatch(.*)*",
  redirect: "/404",
  name: "Any",
  meta: {
    title: "任意路由",
    hidden: true,
    icon: "DataLine",
  },
};
